const EnumRouter = {

  rootRoute: '', // 根路由
  404: '404',
  403: '403',
  login: 'login', // 登录

  /*
     |-----------------------------------------------
     | 首页
     |-----------------------------------------------
  */
  home: 'home',

  /*
     |-----------------------------------------------
     | formManagement
     |-----------------------------------------------
  */
  formManagement: 'formManagement',
  makeForm: 'makeForm',
  formList: 'formList',
  formDetail: 'formDetail',

  /*
    |-----------------------------------------------
    | flow
    |-----------------------------------------------
 */
  flowManagement: 'flowManagement',
  todoList: 'todoList',
  flowList: 'flowList',
  editForm: 'editForm',
  completeFlow: 'completeFlow',
  vieFlowForm: 'vieFlowForm',

  /*
     |-----------------------------------------------
     | example
     |-----------------------------------------------
  */
  example: 'example',
  exampleTable: 'example/table',
  exampleTableDetail: 'example/table/detail',
  exampleTree: 'example/tree',

  /*
    |-----------------------------------------------
    | form
    |-----------------------------------------------
  */
  form: 'form',

  /*
    |-----------------------------------------------
    | nested
    |-----------------------------------------------
  */

  nested: 'nested',
  nestedMenu1: 'nested/menu1',
  nestedMenu1_1: 'nested/menu1/menu1-1',
  nestedMenu1_2: 'nested/menu1/menu1-2',
  nestedMenu1_2_1: 'nested/menu1/menu1-2/menu1-2-1',
  nestedMenu1_2_2: 'nested/menu1/menu1-2/menu1-2-2',
  nestedMenu1_3: 'nested/menu1/menu1-3',
  nestedMenu2: 'nested/menu2'

};
// export default EnumRouter;
export default (() => {
  const routes = {};
  for (const [key, route] of Object.entries(EnumRouter)) {
    Object.defineProperty(routes, key, {
      get: () => {
        return window.ENV.rootPath.replace(/\/$/, '') + '/' + route;
      },
      configurable: false
    });
  }

  return routes;
})();
